package Z09Swing.ZUJian;

import javax.swing.*;
import java.awt.*;

/**
 * @author 李某
 * * @date 2021/10/21
 * *物有本末，事有终始。知其先后者，则近道矣！
 * *荷花开满池塘的前一天还是半塘荷花半塘云。
 */
public class Z09文本框 {}

class test9{
    public static void main(String[] args) {
        JFrame f = new JFrame();
        f.setSize(400,300);
        f.setLocation(200,200);

        f.setLayout(new FlowLayout());

        JLabel IName = new JLabel("账号：");
        JTextField tfname = new JTextField("");
        tfname.setText("请输入账号：");
        tfname.setPreferredSize( new Dimension(80,30));

        JLabel Ipassworld = new JLabel("密码：");
        JTextField tfPassword = new JTextField("");
        tfPassword.setText("请输入密码：");
        tfPassword.setPreferredSize(new Dimension(80,30));

        f.add(IName);
        f.add(tfname);
        f.add(Ipassworld);
        f.add(tfPassword);

        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
        tfPassword.grabFocus();

    }
}
